import 'package:flutter/material.dart';

class Inputwidget extends StatelessWidget {
  //参数
  final String hint;
  final ValueChanged<String>? onChange;
  final bool hidePassword;
  final TextInputType? keyboarbType;

  const Inputwidget(
    this.hint, {
    super.key,
    this.keyboarbType,
    this.onChange,
    this.hidePassword = true,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        _input(),
        Divider(height: 10, color: Colors.white, thickness: 1),
      ],
    );
  }

  _input() {
    return TextField(
      onChanged: onChange,
      keyboardType: keyboarbType,
      obscureText: hidePassword,
      autofocus: !hidePassword,
      style: TextStyle(
        fontSize: 24,
        fontWeight: FontWeight.w400,
        color: Colors.white,
      ),
      decoration: InputDecoration(
        border: InputBorder.none,
        hintText: hint,
        hintStyle: TextStyle(color: Colors.grey, fontSize: 16),
      ),
    );
  }
}
